package com.dyz.leetcode._07_hashSearch;


import java.util.HashSet;
import java.util.Set;

public class _771_numJewelsInStones {
    public int numJewelsInStones(String jewels, String stones) {
        Set<Character> set = new HashSet<>();
        for(char ch:jewels.toCharArray()){
            set.add(ch);
        }
        int res = 0;

        for(char c: stones.toCharArray()){
            if(set.contains(c)){
                res++;
            }
        }
    return res;
    }
}
